<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Title</title>
    <script type="text/javascript" src="vue/vue.js"></script>
</head>
<body>
<div id="app">
         <!--右键点击才会触发方法-->
    <input type="button" value="按钮" @contextmenu="show()">

    <!--阻止右键会出现的菜单   相当于阻止默认行为-->
    <input type="button" value="按钮" @contextmenu="show2($event)">

    <!--vue支持阻止事件默认行为-->
    <input type="button" value="按钮" @contextmenu.prevent="show3()">

</div>

<script>
    new Vue({
        el:'#app',
        data:{
        },
        methods:{
            show:function () {
                alert(1)
            },
            show2:function (e) {
                alert(2)
                e.preventDefault()
            },
            show3:function () {
                alert(1)
            }
        }
    })
</script>

</body>
</html>